home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / dix.h,v < prev    next >
Encoding:
Text File  |  1990-02-15  |  5.4 KB  |  195 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.10;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/***********************************************************
  27. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  28. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  29.  
  30.                         All Rights Reserved
  31.  
  32. Permission to use, copy, modify, and distribute this software and its 
  33. documentation for any purpose and without fee is hereby granted, 
  34. provided that the above copyright notice appear in all copies and that
  35. both that copyright notice and this permission notice appear in 
  36. supporting documentation, and that the names of Digital or MIT not be
  37. used in advertising or publicity pertaining to distribution of the
  38. software without specific, written prior permission.  
  39.  
  40. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  41. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  42. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  43. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  44. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  45. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  46. SOFTWARE.
  47.  
  48. ******************************************************************/
  49. /* $XConsortium: dix.h,v 1.56 89/08/20 12:14:05 rws Exp $ */
  50.  
  51. #ifndef DIX_H
  52. #define DIX_H
  53.  
  54. #include "gc.h"
  55. #include "window.h"
  56.  
  57. #define EARLIER -1
  58. #define SAMETIME 0
  59. #define LATER 1
  60.  
  61. #define NullClient ((ClientPtr) 0)
  62. #define REQUEST(type) \
  63.     register type *stuff = (type *)client->requestBuffer
  64.  
  65.  
  66. #define REQUEST_SIZE_MATCH(req)\
  67.     if ((sizeof(req) >> 2) != stuff->length)\
  68.          return(BadLength)
  69.  
  70. #define REQUEST_AT_LEAST_SIZE(req) \
  71.     if ((sizeof(req) >> 2) > stuff->length )\
  72.          return(BadLength)
  73.  
  74. #define REQUEST_FIXED_SIZE(req, n)\
  75.     if (((sizeof(req) >> 2) > stuff->length) || \
  76.         (((sizeof(req) + (n) + 3) >> 2) != stuff->length)) \
  77.          return(BadLength)
  78.  
  79. #define LEGAL_NEW_RESOURCE(id,client)\
  80.     if (!LegalNewID(id,client)) \
  81.     {\
  82.     client->errorValue = id;\
  83.         return(BadIDChoice);\
  84.     }
  85.  
  86. #define LOOKUP_DRAWABLE(did, client)\
  87.     ((client->lastDrawableID == did) ? \
  88.      client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
  89.  
  90. #define VERIFY_GC(pGC, rid, client)\
  91.     if (client->lastGCID == rid)\
  92.         pGC = client->lastGC;\
  93.     else\
  94.     pGC = (GC *)LookupIDByType(rid, RT_GC);\
  95.     if (!pGC)\
  96.     {\
  97.     client->errorValue = rid;\
  98.     return (BadGC);\
  99.     }
  100.  
  101. #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\
  102.     if ((client->lastDrawableID != drawID) || (client->lastGCID != stuff->gc))\
  103.     {\
  104.         if (client->lastDrawableID != drawID)\
  105.             pDraw = (DrawablePtr)LookupIDByClass(drawID, RC_DRAWABLE);\
  106.         else\
  107.         pDraw = client->lastDrawable;\
  108.         if (client->lastGCID != stuff->gc)\
  109.         pGC = (GC *)LookupIDByType(stuff->gc, RT_GC);\
  110.         else\
  111.             pGC = client->lastGC;\
  112.     if (pDraw && pGC)\
  113.     {\
  114.         if ((pDraw->type == UNDRAWABLE_WINDOW) ||\
  115.         (pGC->depth != pDraw->depth) ||\
  116.         (pGC->pScreen != pDraw->pScreen))\
  117.         return (BadMatch);\
  118.         client->lastDrawable = pDraw;\
  119.         client->lastDrawableID = drawID;\
  120.             client->lastGC = pGC;\
  121.             client->lastGCID = stuff->gc;\
  122.     }\
  123.     }\
  124.     else\
  125.     {\
  126.         pGC = client->lastGC;\
  127.         pDraw = client->lastDrawable;\
  128.     }\
  129.     if (!pDraw)\
  130.     {\
  131.         client->errorValue = drawID; \
  132.     return (BadDrawable);\
  133.     }\
  134.     if (!pGC)\
  135.     {\
  136.         client->errorValue = stuff->gc;\
  137.         return (BadGC);\
  138.     }\
  139.     if (pGC->serialNumber != pDraw->serialNumber)\
  140.     ValidateGC(pDraw, pGC);
  141.  
  142. #define WriteReplyToClient(pClient, size, pReply) \
  143.    if ((pClient)->swapped) \
  144.       (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \
  145.            (pClient, (int)(size), pReply); \
  146.       else (void) WriteToClient(pClient, (int)(size), (char *)(pReply));
  147.  
  148. #define WriteSwappedDataToClient(pClient, size, pbuf) \
  149.    if ((pClient)->swapped) \
  150.       (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \
  151.    else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf));
  152.  
  153. typedef struct _TimeStamp *TimeStampPtr;
  154. typedef struct _Client *ClientPtr;
  155. extern ClientPtr requestingClient;
  156. extern ClientPtr *clients;
  157. extern ClientPtr serverClient;
  158. extern int currentMaxClients;
  159.  
  160. extern int ProcAllowEvents();
  161. extern int ProcBell();
  162. extern int ProcChangeActivePointerGrab();
  163. extern int ProcChangeKeyboardControl();
  164. extern int ProcChangePointerControl();
  165. extern int ProcGetKeyboardMapping();
  166. extern int ProcGetPointerMapping();
  167. extern int ProcGetInputFocus();
  168. extern int ProcGetKeyboardControl();
  169. extern int ProcGetMotionEvents();
  170. extern int ProcGetPointerControl();
  171. extern int ProcGrabButton();
  172. extern int ProcGrabKey();
  173. extern int ProcGrabKeyboard();
  174. extern int ProcGrabPointer();
  175. extern int ProcQueryKeymap();
  176. extern int ProcQueryPointer();
  177. extern int ProcSetInputFocus();
  178. extern int ProcSetKeyboardMapping();
  179. extern int ProcSetPointerMapping();
  180. extern int ProcSendEvent();
  181. extern int ProcUngrabButton();
  182. extern int ProcUngrabKey();
  183. extern int ProcUngrabKeyboard();
  184. extern int ProcUngrabPointer();
  185. extern int ProcWarpPointer();
  186. extern int ProcRecolorCursor();
  187.  
  188. extern WindowPtr LookupWindow();
  189. extern pointer LookupDrawable();
  190.  
  191. extern void NoopDDA();
  192.  
  193. #endif /* DIX_H */
  194. @
  195.